<?php


namespace App\Helper;


class Validate
{

    public static function mobile($phone)
    {
        $ret = false;
        //判断是否有值
        if ($phone) {
            $phone_preg = '#^13[\d]{9}$|^14[5,7]{1}\d{8}$|^15[^4]{1}\d{8}$|^17[0,6,7,8]{1}\d{8}$|^18[\d]{9}$#';
            //判断是否是正确手机号
            if (preg_match($phone_preg, $phone)) {
                $ret = true;
            }
        }
        return $ret;
    }

}